package com.share.device.controller;


import com.share.common.core.web.controller.BaseController;
import com.share.common.core.web.page.TableDataInfo;
import com.share.device.domain.CabinetType;
import com.share.device.service.ICabinetTypeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "柜机类型接口管理")
@RestController
@RequestMapping("/cabinetType")
public class CabinetTypeController extends BaseController {

	@Autowired
	private ICabinetTypeService cabinetTypeService;

	// 分页查询
	@Operation(summary = "柜机类型分页查询")
	@GetMapping("/list")
	public TableDataInfo list(CabinetType cabinetType){
		// 通过ruoyi封装的函数获取分页参数数据
		startPage();
		// 调用service查询数据库
		List<CabinetType> list = cabinetTypeService.selectCabinetTypeList(cabinetType);
		TableDataInfo dataTable = getDataTable(list);
		return dataTable;

	}

}
